package GamePlayStrategy.source;

import java.io.InputStream;

import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable;

public class Heroes 
{
	private String name = new String(); // name of hero
	private String hero_class = new String(); // class of the hero
	private int level; // experienced level of hero
	private int strength, dexterity, magic, holiness; // abillities of hero
	private int experience; // experience of the hero
	private int max_health; // maximum health of hero
	private int health; // current health of hero
	private int avatar; // avatar of the hero
	private String state = null;
	
	private String location = null; // Location of hero on the map, ex. H4
	
	// Set of setters
	
	public void set_name(String name)
	{
		this.name = name;
	}
	public void set_hero_class(String hero_class)
	{
		this.hero_class = hero_class;
	}
	public void set_level(int level)
	{
		this.level = level;
	}
	public void set_strength(int strength)
	{
		this.strength = strength;
	}
	public void set_dexterity(int dexterity)
	{
		this.dexterity = dexterity;
	}
	public void set_magic(int magic)
	{
		this.magic = magic;
	}
	public void set_holiness(int holiness)
	{
		this.holiness = holiness;
	}
	public void set_experience(int experience)
	{
		this.experience = experience;
	}
	public void set_health(int health)
	{
		this.health = health;
	}
	public void set_avatar(int avatar)
	{
		this.avatar = avatar;
	}
	public void set_avatar(InputStream is, String srcName)
	{
		//this.avatar = (BitmapDrawable) BitmapDrawable.createFromStream(is, srcName);
	}	
	public void set_location(String location)
	{
		this.location = location;
	}
	public void set_state(String state)
	{
		this.state = state;
	}
	
	
	// Set of getters
	
	public String get_name()
	{
		return this.name;
	}
	public String get_skill_class()
	{
		return this.hero_class;
	}
	public int get_level()
	{
		return this.level;
	}
	public int get_strength()
	{
		return this.strength;
	}
	public int get_dexterity()
	{
		return this.dexterity;
	}
	public int get_magic()
	{
		return this.magic;
	}
	public int get_holiness()
	{
		return this.holiness;
	}
	public int get_experience()
	{
		return this.experience;
	}
	public int get_health()
	{
		return this.health;
	}
	public int get_avatar()
	{
		return this.avatar;
	}
	public String get_location()
	{
		return this.location;
	}
	public String get_state()
	{
		return this.state;
	}
	
	public boolean create_hero(String name, String hero_class, int level, int strength, int dexterity, int magic, 
			int holiness, int experience, int avatar)
	{
		this.name = name;
		this.hero_class = hero_class;
		this.level = level;
		this.strength = strength;
		this.dexterity = dexterity;
		this.magic = magic;
		this.holiness = holiness;
		this.experience = experience;
		this.avatar = avatar;
		
		return true;
	}
	
	public int on_hit(int damage)
	{
		if((this.health -= damage) <= 0)
		{
			this.state = "Hero has parrished, due to sustained wounds.";
		}
		return this.health;
	}
	public int on_heal(int healing)
	{
		if((this.health += healing) > this.max_health)
		{
			this.health = this.max_health;
			this.state = "Full health has been restored.";
		}
		else
		{
			this.state = healing + " of health has been restored.";
		}
		return this.health;
	}
	
	Heroes()
	{}
	
	public Heroes(String name, String hero_class, int level, int strength, int dexterity, int magic, 
			int holiness, int experience, int avatar)
	{
		this.name = name;
		this.hero_class = hero_class;
		this.level = level;
		this.strength = strength;
		this.dexterity = dexterity;
		this.magic = magic;
		this.holiness = holiness;
		this.experience = experience;
		this.avatar = avatar;
	}
	
}

